Fix broken unit tests in time-planning-pn components#1122
Merged
renemadsen merged 2 commits intomasterfrom Oct 19, 2025
Merged
Conversation
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix broken unit tests for AssignedSiteDialogComponent
Fix broken unit tests in time-planning-pn components
Oct 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixed two failing unit tests in the time-planning-pn plugin components that were preventing the CI/CD pipeline from passing.
Issues Fixed
1. AssignedSiteDialogComponent Test Expectations
The test
should copy break settings from global settings for mondaywas failing because it expected numeric minute values, but the implementation converts these to time strings.The Problem:
The Fix:
Updated test expectations to match the actual converted string format:
480minutes →"08:00"30minutes →"00:30"60minutes →"01:00"2. DownloadExcelDialogComponent RxJS Error
The
onDownloadExcelReportAllWorkersandonDownloadExcelReportmethods were usingcatchErrorincorrectly, causing the error:The Problem:
The Fix:
EMPTYfrom rxjscatchErrorto returnEMPTY(a valid empty observable)caughttoerrorfor clarityTest Results
All 119 tests in the time-planning-pn module now pass:
The console warnings about navigation in jsdom are expected browser API limitations in the test environment and do not affect test functionality.
Original prompt
This section details on the original issue you should resolve
<issue_title>Fix broken unit tests</issue_title>
<issue_description>```
FAIL src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.spec.ts (30.226 s)
● AssignedSiteDialogComponent › Break Settings › should copy break settings from global settings for monday
FAIL src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/download-excel/download-excel-dialog.component.spec.ts (7.579 s)
● Console
Fixes #1121
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.